//#import ".h"
#import "TileSet.h"

@protocol TapWalkMapDelegate;
@class Entity;
#define TILE_EMPTY    0
#define TILE_PEOPLE   1
#define TILE_BUILDING 2
#define TILE_ITEM	  3
#define TILE_WALL	  4
#define TILE_GATEWAY  5
#define TILE_NPC	  6
#define TILE_ENEMY	  7


@interface WalkMap : UIView {
	
    id <TapWalkMapDelegate> delegate;
    CGPoint tapLocation,goal;         // Needed to record location of single tap, which will only be registered after delayed perform.
    BOOL multipleTouches;        // YES if a touch event contains more than one touch; reset when all fingers are lifted.
    BOOL twoFingerTapIsPossible; // Set to NO when 2-finger tap can be ruled out (e.g. 3rd finger down, fingers touch down too far apart, etc).
	TileSet* tileSet,*spriteSet,*shopSet,*itemSet,*gatewaySet;	
	UIImage* back;
	NSMutableArray* tiles,*people,*items,*shops,*gateways;
	int tileMap[100][100];
	int tileSize,spriteSize,shopSize,itemHeight,itemWidth,movement;
	Entity* player;
	
}

@property (nonatomic, assign) id <TapWalkMapDelegate> delegate;
@property (nonatomic, retain) TileSet* tileSet,*spriteSet,*shopSet,*itemSet,*gatewaySet;
@property (nonatomic, retain) NSMutableArray* tiles,*people,*shops,*items,*gateways;
@property (nonatomic, retain) Entity* player;

@property int spriteSize,tileSize;
-(id) initWithBackground:(NSString*)name;
-(int)stateMachine;
-(int)getType:(int)x y:(int)y;
-(void)setType:(int)f x:(int)x y:(int)y;

@end


/*
 Protocol for the tap-detecting image view's delegate.
 */
@protocol TapWalkMapDelegate <NSObject>

@optional
- (void)tapWalkMap:(WalkMap *)view gotSingleTapAtPoint:(CGPoint)tapPoint;
- (void)tapWalkMap:(WalkMap *)view gotDoubleTapAtPoint:(CGPoint)tapPoint;
- (void)tapWalkMap:(WalkMap *)view gotTwoFingerTapAtPoint:(CGPoint)tapPoint;

@end
